const fs = require('fs');
const path = require('path')
const ReadConfigFile = async (name = '') => {
	const filePath = path.join(__dirname, `../config/${name}.json`);
	console.log('filePath', filePath)
	const data = fs.readFileSync(filePath, 'utf8');
	return JSON.parse(data)
}


const WriteConfigFile = async (name = '', data = {}) => {
	const filePath = path.join(__dirname, `../config/${name}.json`);

	fs.writeFileSync(filePath, JSON.stringify(data), 'utf8')
	return true
}

module.exports = {
	ReadConfigFile,
	WriteConfigFile
}